package com.zhilianbao.leyaogo.utils;

import android.content.Context;
import android.support.annotation.StringRes;

import com.bql.variousdialog.widget.base.BaseDialog;
import com.zhilianbao.leyaogo.view.dialog.ToastDialog;

/**
 * ClassName: XToastDialog <br>
 * Description: 提示对话框<br>
 * Author: Cyarie <br>
 * Created: 2016/11/25 09:41 <br>
 * Update Time：<br>
 * Update Description：<br>
 */
public class XTipsDialog {

    public static void showSuccess(Context context, String msg) {
        showSuccess(context, msg, null, 1200);
    }

    public static void showSuccess(Context context, String msg, BaseDialog.IDelayDismissEnd dismissEnd) {
        showSuccess(context, msg, dismissEnd, 1200);
    }

    public static void showSuccess(Context context, String msg, long delay) {
        showSuccess(context, msg, null, delay);
    }

    public static void showSuccess(Context context, @StringRes int resId) {
        showSuccess(context, context.getString(resId), null, 1200);
    }

    public static void showSuccess(Context context, @StringRes int resId, BaseDialog.IDelayDismissEnd dismissEnd) {
        showSuccess(context, context.getString(resId), dismissEnd, 1200);
    }

    public static void showSuccess(Context context, @StringRes int resId, long delay) {
        showSuccess(context, context.getString(resId), null, delay);
    }

    public static void showSuccess(Context context, String msg, BaseDialog.IDelayDismissEnd dismissEnd, long delay) {
        new ToastDialog(context).success().tips(msg).autoDismiss(true).autoDismissDelay(delay).dismissDelayEnd(dismissEnd).show();
    }


    public static void showFail(Context context, String msg) {
        showFail(context, msg, null, 1200);
    }

    public static void showFail(Context context, String msg, BaseDialog.IDelayDismissEnd dismissEnd) {
        showFail(context, msg, dismissEnd, 1200);
    }

    public static void showFail(Context context, String msg, long delay) {
        showFail(context, msg, null, delay);
    }

    public static void showFail(Context context, @StringRes int resId) {
        showFail(context, context.getString(resId), null, 1200);
    }


    public static void showFail(Context context, @StringRes int resId, BaseDialog.IDelayDismissEnd dismissEnd) {
        showFail(context, context.getString(resId), dismissEnd, 1200);
    }

    public static void showFail(Context context, @StringRes int resId, long delay) {
        showFail(context, context.getString(resId), null, delay);
    }


    public static void showFail(Context context, String msg, BaseDialog.IDelayDismissEnd dismissEnd, long delay) {
        new ToastDialog(context).fail().tips(msg).autoDismiss(true).autoDismissDelay(delay).dismissDelayEnd(dismissEnd).show();
    }
}
